import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'

// import * 的意思就是可以通过 **.** 使用

import state from './state'
import mutations from './mutations'
// 在控制台打印log
import createLogger from 'vuex/dist/logger'

Vue.use(Vuex)

// vuex调试
// 检测对 state 的修改是不是来自于 commit mutations
const debug = process.env.NODE_ENV !== 'production'

export default new Vuex.Store({
  actions, getters, state, mutations, strict: debug, plugins: debug ? [createLogger()] : []
})
